package com.example.happiness.service.user.Impl;

import com.example.happiness.constant.Message;
import com.example.happiness.mapper.ServeMapper;
import com.example.happiness.pojo.Serve;
import com.example.happiness.service.user.UserServeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServeServiceImpl implements UserServeService {
    @Autowired
    ServeMapper serveMapper;

    public List<Serve> getServeList(Integer cid) {
        Integer state= Message.ONE;
        return serveMapper.getServeListandStateOne(cid,state);
    }

    public Serve getserve(Integer sid) {
        return serveMapper.selectByPrimaryKey(sid);
    }

    public Integer getBysname(String sname) {
        return serveMapper.getBysname(sname);
    }

    public List<Serve> getHotServe() {

        return serveMapper.getHotServe();
    }
}
